import * as echarts from 'echarts';
const myEcharts = echarts.init(document.querySelector('.pie2 .chart'));

const option = {
  legend: {
    top: 'bottom',
    itemWidth: 10,
    itemHeight: 10,
    textStyle: {
      color: '#fff',
      fontSize: 10
    }
  },
  color: ['#006cff', '#60cda0', '#ed8884', '#ff9f7f', '#0096ff', '#9fe6b8', '#32c5e9', '#1d9dff'],
  series: [
    {
      name: '面积模式',
      type: 'pie',
      radius: [30, 110],
      center: ['50%', '40%'],
      roseType: 'radius',
      radius: ['10%', '70%'],
      label: {
        fontSize: 10,
        color: '#fff'
      },
      labelLine:{
        length: 6,
        length2: 8
      },
      itemStyle: {
        borderRadius: 4
      },
      data: [
        { value: 5149834, name: '法国' },
        { value: 4666209, name: '俄罗斯' },
        { value: 4378305, name: '英国' },
        { value: 4025557, name: '土耳其' },
        { value: 3809193, name: '意大利' },
        { value: 3387022, name: '西班牙' },
        { value: 3064382, name: '德国' },
        { value: 1561559, name: '南非' }
      ]
    }
  ]
};

myEcharts.setOption(option);

window.addEventListener('resize', function () {
  myEcharts.resize();
});
